package com.voxel.sense.infomsg.module.task.check.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.request.RequestOptions;
import com.example.com.common.view.recycler.RecyclerAdapter;
import com.voxel.sense.infomsg.R;
import com.voxel.sense.infomsg.data.bean.MultiItemBean;
import com.voxel.sense.infomsg.utils.GlideUtils;

import butterknife.BindView;

/**
 * @author ChenYiYao
 * @date 2018/5/14
 * des :
 */
public class FileHolderView extends RecyclerAdapter.ViewHolder<MultiItemBean<String>> {
    @BindView(R.id.iv_pic)
    ImageView iv_pic;
    @BindView(R.id.iv_delete)
    ImageView iv_delete;
    @BindView(R.id.tv_desc)
    TextView tv_desc;


    public FileHolderView(View itemView) {
        super(itemView);
    }

    @Override
    protected void onBind(MultiItemBean<String> bean) {
        tv_desc.setText(bean.getExtra());
        RequestOptions error = RequestOptions.centerInsideTransform() // 居中剪切
                .placeholder(R.mipmap.icon_img_loading)
                .error(R.mipmap.file_icon);
        GlideUtils.GlideLoadPic(tv_desc.getContext(), R.mipmap.file_icon, iv_pic, error);
        iv_delete.setVisibility(View.GONE);
    }
}
